package com.zju.DoctorGo.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "9021000137608994";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCq7/AbPDAWl86rurHnZ4EllI8xeentwxvkP4gT/8tVVq4umLShBdZSv6wlMTMw1GjkIxe+cV9hfTNUumKNzaNqzCFHXlKcIwV/MPa2syonWpJrOQ4GZ/lneoAqzWKmtGLm2Z2Ml3oaUXmtQHbIDHOOzkq66XWZiCd3e76vNX50Ge/gtRiC68aXY8vhFJdfwLsAbqITuEcxQX5AFHfvPyXcB/E/+UdE+Gtm3e8SSQMcbeNe+P1VrZlak1E+6W7sEbb1RMJK+Fe3axjak9peR+PmLAcAJOel5NQfna3PUZ7q2FHL4k+E3bsAkvofVtI2HcILcRTUQoITGi8qSCCrzVAhAgMBAAECggEAI2LeYtT344VzrEtOzue3bY8ugYCKc8UDPiIEypcWgcka79x+8CKkNqclPOHNhhtCx4+YN72CkEz51l1rT421ecNeVEbrdRUu6yC4wiOe41y1mOrLw3m8wLY0WCgCdx46py1/lv44scASH1KMBGfHeFWuVLlFtg3glbSRSfYaAnCQc61JspEeGn83+y9YgLkIXzk+GJIGtJaS/8O0pAb91PwKtNMnaip4hFqmox77QXC3/fYY7rIa8wURIDoC3q+LeCmtGN5EwJHpxSv4JZcvrG0P06z8Fun7ry3w6I6soawHZubuGxpPDBagKyZc36oOH40EaU01zGAhBGGCUbKp7QKBgQD0jKrpCAaXe5LjEk22VKHcQ49eoLUYH+tnSub3o6RBehzlUajYo23Hw+kjPfzai5UH5b8Dg9P4Q4xmULgJvvW18okiV3e55Q6xD8u8OdPwu8rt1UQh1nQe5nC6LBAacCrF/cZckkVIxMlMGPOA7i2uLuDTk47LVa82g0PovlTKSwKBgQCy8OfCwf+RzW1FONXKrpgfXD/n9JrGVNhthhSuK/MDtLzqvge+NzvnTiKvwYxwaYYgRvAkaWONQYU55JrQ9qUMgfJ0QilkDANV+lZZP9hKufrSZMXLQ/T4c571XUI2TA7pDv6WlOuejNGecXFC8JfUbizjyXlUjUPFtunTcdILwwKBgEoVq1k5UzXk+9TKoLxR208tMGvMZ9BNKzV5nYr8CjDD26klGe+3YvSXxzMj/kv+6UEhOsLH1xlo7Um5vmdFcI6UUTMUKHMqj07YqDH3mttdKNbwOtm9bCRIT3I3ExHPVUXx4Xv92/t1kj35eRtgDHquPPIby7CR3qi3D4Wc03cNAoGBAJRSkZji22fMwp1VPgkx7ZBZE/O90ilBnOAz+qJgdaAFyW4+tAZcnD/fiWrr4PAw1+ebRWS5Irasr7TMI/O/7hFPCVyKluqB9qXmynpSLIPMYvbQZw9UthLXK9SwR7jgFJ/kOO0yZZfXm81ctQhKi1+fL4BkuTh3m8ygEHOe7f+nAoGBAM+ss4vFSmqbSeJsJTGIVOuxbWmWWtMz+QXKCD2Wgqb19VFtiROBIymFBeYD+butuezFwXxx4LYHvLPyWqoMB/nnNcbtqhr51bbE5DlSlau6wWNRq6G0Njz4XubDpx4ZBcPrsm/qjsrOKMUAiE1DoBFS+rBWFta5LaKIQfXz3W//";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAj9MdpGSALGYAt4VG1/+L0z/+8cvjgtqt5N5F0SFefrVqYL4TCEsGt5jOR8SE96MXMW3jw1nskHe1TxrVSqglcQho0qOk/75mlqtCYwWMK5mwluI6sOGzLttbveL4u5+8nWC0UKL/5qeJxW/GPv5wc0ePU9b1ox9x1B4lwd+jEi/TsAv5CDHk2Tzk6dBekSenfmTlrKNIhO2J+KP775fvDu3ODNq67OUhjVouHfhGbKkMLfT5/lrkYK/LLHIgslAjGLM1dKnm1v7Rpfxu2Wv1eahdoQznhQtwbfUfu0xWVYpftFgmpJRXP3ro1VqrtaLNHaQxrmTZyPT3hZmL5M/PtwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://bmwt9c.natappfree.cc/api/callback/notify";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://bmwt9c.natappfree.cc/api/callback/return";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

    // 日志目录
    public static String log_path = "./";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

